package cn.tedu.community.commons.utils;

import java.io.File;
import java.io.FileOutputStream;

public class FileUtil {
    public static void uploadFile(byte[] file,String filePath,String filename) throws Exception {
        File targetFile=new File(filePath);
        if(!targetFile.exists()){
            targetFile.mkdirs();
        }
        FileOutputStream out=new FileOutputStream(targetFile.getAbsoluteFile()+"/"+filename);
        out.write(file);
        out.close();
    }
}
